package top.bulk.intemasking.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import top.bulk.intemasking.annotation.SensitiveMasking;
import top.bulk.intemasking.enums.SensitiveTypeEnum;

/**
 * 用户信息实体类
 *
 * @author 散装java
 * @date 2024-07-15
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class UserEntity {
    /**
     * 用户姓名
     */
    @SensitiveMasking(type = SensitiveTypeEnum.CHINESE_NAME)
    private String name;

    /**
     * 用户手机号
     */
    @SensitiveMasking(type = SensitiveTypeEnum.PHONE)
    private String phoneNumber;
    /**
     * 自定义脱敏手机号
     */
    @SensitiveMasking(type = SensitiveTypeEnum.CUSTOM_RULE, startInclude = 2, endExclude = 7, replacedChar = '?')
    private String phone;

    /**
     * 用户电子邮件地址
     */
    @SensitiveMasking(type = SensitiveTypeEnum.EMAIL)
    private String email;

    /**
     * 用户密码
     */
    @SensitiveMasking(type = SensitiveTypeEnum.PASSWORD)
    private String password;

    /**
     * 用户身份证号码
     */
    @SensitiveMasking(type = SensitiveTypeEnum.ID_CARD)
    private String idCard;

    /**
     * 用户银行卡号
     */
    @SensitiveMasking(type = SensitiveTypeEnum.BANK_CARD)
    private String bankCard;

    /**
     * 用户地址
     */
    @SensitiveMasking(type = SensitiveTypeEnum.ADDRESS)
    private String address;

    /**
     * 三方账户名称，自定义脱敏规则
     */
    @SensitiveMasking(type = SensitiveTypeEnum.CUSTOM_RULE, startInclude = 2, endExclude = 4, replacedChar = '?')
    private String account;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 性别
     */
    private String sex;
}
